1. Field of the Invention
The present invention relates to context adaptive binary arithmetic coding (CABAC) and more particularly, to a method which can quickly initialize context models for a new data slice in the process of context adaptive binary arithmetic coding, and a coding apparatus using the same.
2. Description of the Related Art
Compression coding is required for storing or transmitting data, especially of a video sequence, which is composed of images. A standard for encoding and decoding of video data is established as H.264, which is also known as MPEG4, part 10, “Advanced Video Coding”. The standard specifies two types of entropy coding, namely context-based adaptive binary arithmetic coding (CABAC) and variable-length coding (VLC).
In the H.264 process, an image is split in macro blocks. A macro block comprises a 16×16 pixels luminance block and two 8×8 pixels chrominance blocks. A slice is a collection of macro blocks belonging to a single image. The H.264 bit stream is structured in NAL units, each NAL unit contains the information of one slice.
H.264 optionally uses context adaptive binary arithmetic coding to further compress data that has already been compressed using spatial and temporal prediction, transforms, quantization and other techniques.
CABAC coding does not result in the loss of information, but may result in considerable compression gains. A syntax element, which typically represents a coefficient or other datum from prior compression is further encoded as a variable length sequence of binary bits (“bins”), and the individual bins are there encoded using arithmetic coding. A bin is typically a two-valued symbol. A sequence of symbols is expressed as a single fractional binary number between 0 and 1 using recursive subdivision of intervals to encode successive symbols. The number has as many fractional bits of precision as are needed to express its value. The relative likelihood of occurrence of a 1 and a 0 is used to encode the bin with statistically optimal efficiency. A dynamic context table is kept with likelihood entries for each of many different types of bins within syntax elements in the decoder. The context table is initialized at the beginning of a new slice of video data.
Thus, context-based adaptive binary arithmetic coding (CABAC) achieves good compression performance through selecting probability models for each syntax element according to the element's context and adapting probability estimates based on local statistics and using arithmetic coding. Coding a data symbol involves the stages of    a) binarization, wherein a non-binary-valued symbol, e.g. a transform coefficient or motion vector, is binarized or converted into a binary code prior to arithmetic coding;and for each bit or bin of the binarized symbol:    b) context model selection, wherein a context model is a probability model for one or more bins of the binarized symbol, which had been chosen from a selection of available models depending on the statistics of recently-coded data symbols. The context model stores the probability of each bin beam “1” or “0”;    c) arithmetic encoding, wherein an arithmetic coder encodes each bin according to the selected probability model; and    d) probability update, wherein the selected context model is updated based on the actual coded value, e.g. if the bin value was “1”, the frequency count for the “1”-bins is increased.
The context models and binarization schemes for each syntax element are defined in the H.264- and MPEG-4-standard. There are a total of 267 separate context models for the various syntax elements. Some models have different uses depending on the slice type. For example, skipped macro blocks are not permitted in an I-slice and so context models 0 to 2 are used to code bins of macro block-skip or macro block-type depending on whether the current slice is Intra coded.
At the beginning of each coded slice, the context models are initialized depending on the initial value of the sequentialization parameter, since it has a significant effect on the probability of occurrence of the various data symbols.
US 2004/0260739 A1 discloses a system and apparatus for accelerating arithmetic decoding of encoded data wherein a stream of intermediate binary symbols is generated from the context adaptive binary arithmetic coded data at the channel rate. The stream of intermediate binary symbols is then decoded at a consumption rate. Context table values are developed from the previous bins processed in the arithmetic decoder and stored in a context RAM.
US 2006/0017592 A1 discloses a method of context adaptive binary arithmetic coding comprising and generating a plurality of syntax elements of residual blocks, grouping flags of the plurality of syntax elements and coding the grouped flags. Thus, coding is performed for the group flags rather than on the syntax elements.
FIG. 1 is a block diagram of a conventional part of a CABAC coding apparatus including the unit required for initialization computation within advanced cycles. As a regulation for the computation of the initial context variable value is given by the initialization arisen in the H.264 standard as follows:                1. preCtxState=Clip3 (1,126, ((m×Clip3 (0,51, Slice QPy))>>4)+n)        2. if (preCtxState<=63) {                    pstateIdx=63−preCtxState            valMps=0            } else {            pStateIdx=preCtxState−64            valMps=1            }            Context Variable={paStateIdx, valMps}                        
      Clip    ⁢                  ⁢    3    ⁢          (              x        ,        y        ,        z            )        =      {                                        x            ;                          z              1                                                                        y            ;                          z              >              y                                                                        z            ;            otherwise                              
This initialization algorithm is to be accomplished for all n context variables with each new frame. In case of n=460, a conventional procedure of 460 clock cycles are needed, to initialize all of 460 context variables, before starting this decoding and/or encoding.
In the conventional CABAC apparatus, the context index value is fed via a multiplexer to a context memory together with a new initialized context variable or a new context variable value. In case of the counter starting for each new slice from 0 to n (e.g. n=460) the multiplexer for the context index is set to 0 and the multiplexer for the context variable is also set to 0. The initializing cycle is finished after the index count reached n, so that the multiplexers are switched to “1” in order to update the context table entries with the new context variable in relation to the actual context index.
The decoder and/or encoder is connected to the output of the context memory.
The index counter is reset to 0 for each new slice and controls a table for all available n context variables and corresponding values m used for the initializing algorithm in step a).
The n,m table is used for the initializing algorithm, which is provided for computation of the initial context variable value, which is stored in the context memory induced in the following coding process.
As a lead time of n clock cycles, n being the amount of available context variables, causes bottle-neck situation in the entire CABAC procedure.